# -*- coding: utf-8 -*-

# Define your item pipelines here
#
# Don't forget to add your pipeline to the ITEM_PIPELINES setting
# See: https://docs.scrapy.org/en/latest/topics/item-pipeline.html


class Csdntest1Pipeline(object):
    def process_item(self, item, spider):
        # 先打印一个文件，看会保存到哪里
        # 需要开启setting的pipeline
        with open('html/%s.html' % item['title'], 'wb') as f:
            f.write(item['data'])
        return item